Conversation
…oized sets of analyses
…enerateProcedureSummaries and generateRelyGuaranteeConditions; added documentation to Transform, StaticAnalysis and AnalysisManager classes; started on transforms for doSimplify
…e appropriate locations
|
|
…orms out of RunUtils.IRTransforms. Created some new transforms.
katrinafyi
left a comment
There was a problem hiding this comment.
seems fine, it's very good to unify the dumping and logging things.
comments are more for future work
| if memo.isEmpty then memo = Some(analysis(AnalysisManager.this)) | ||
| memo.get |
There was a problem hiding this comment.
i dont really like the need to wrap parametrised transforms in a get method. maybe the Transform class can be changed to take an additional custom parameter.
| trait Log { | ||
| def dump(ctx: IRContext, transformName: String): Unit | ||
| } | ||
|
|
||
| // dumps a blockgraph log | ||
| case class BlockgraphLog(filenamePrefix: String) extends Log { | ||
| def dump(ctx: IRContext, transformName: String): Unit = | ||
| DebugDumpIRLogger.writeToFile( | ||
| File(s"${filenamePrefix}_blockgraph-${transformName}.dot"), | ||
| dotBlockGraph(ctx.program.mainProcedure) | ||
| ) | ||
| } | ||
|
|
||
| // dumps an IR log | ||
| case class IrLog(filenamePrefix: String) extends Log { | ||
| def dump(ctx: IRContext, transformName: String): Unit = | ||
| DebugDumpIRLogger.writeToFile(File(s"${filenamePrefix}_il-${transformName}.il"), pp_prog(ctx.program)) | ||
| } |
There was a problem hiding this comment.
what's the point of this? these could just be methods surely
There was a problem hiding this comment.
i think this method belongs more in the AnalysisManager, but shrug
There was a problem hiding this comment.
single transform could be done as a special case of transform batch
…reamlined the Transform and TransformBatch classes
|
This most recent merge had some pretty significant conflicts. Fortunately, most of these were due to @katrinafyi's changes to the IRLoading object, which @ailrst moved to a new file in the feature branch. I resolved these by overwriting the new file with Kait's changes. Another was due to the new loop invariant generation pass, which I resolved by creating a new reducibleLoops function in AnalysePipelineMRA.scala, effectively re-creating the function added to the now-removed StaticAnalysis object in RunUtils. One important change that I'm not sure about is the tests. Particularly, I removed some tests from IntervalDSATest.scala in an attempt to capture the latest changes made to the file. I'm not sure if this was correct and it would be good to check this with the author of the tests. To ensure the refactor preserves the old behaviour, I loosely combed through the prepareForTranslation and doCleanup transforms and didn't find any discrepancies with the original functions in RunUtils. The doSimplify transform is still under development in Simp.scala. |
Some initial progress towards cleaning up RunUtils. Created classes Transform, StaticAnalysis and AnalysisManager. Refactored doCleanup, prepareForTranslation, generateRelyGuaranteeConditions, and generateFunctionSummaries to use the Transform class.
Some initial progress towards cleaning up RunUtils.
Created classes Transform, StaticAnalysis and AnalysisManager. Refactored doCleanup, prepareForTranslation, generateRelyGuaranteeConditions, and generateFunctionSummaries to use the Transform class.